package controller

import (
	"github.com/gofiber/fiber"
	"gowork/recruit/model"
	"gowork/recruit/service"
)

type PositionController struct {
	PositionService *service.PositionService
}

func (pc *PositionController)SubmitResume(c *fiber.Ctx){

	pc.PositionService = new(service.PositionService)

	var jsp model.JobSeekersPosition
	c.BodyParser(&jsp)

	res , err := pc.PositionService.SubmitResume(&jsp)
	if err != nil{
		c.JSON(fiber.Map{
			"code": 500,
			"data": nil,
			"message": err.Error(),
		})
		return
	}

	c.JSON(fiber.Map{
		"code": res["code"],
		"data": nil,
		"message": res["message"],
	})
	return
}

